package com.designpattern.prototype;

import com.alibaba.fastjson.JSON;

public class Main {

    /**
     * 原型模式
     * @param args
     */
    public static void main(String[] args) {
        PrototypeBean bean = new PrototypeBean();
        bean.setName("zxs");
        try {
            PrototypeBean bean1 = bean.clone();
            System.out.println(JSON.toJSONString(bean1));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
